/*******************************************************************
This file is part of iAgenda.

iAgenda is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

iAgenda is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with iAgenda.  If not, see <http://www.gnu.org/licenses/>.
*******************************************************************/

#pragma once

#include "CSettings.h"

#define SZ_APP_NAME             TEXT("iAgenda")

#define IDI_IAGENDA		        101

#define PRIMARY_TEXT_LENGTH     64
#define SECONDARY_TEXT_LENGTH   24

enum DataItemType {
    diNothing, diListItem, diText, diSubject, diLocation,
    //diDetailsButton, 
	diEditButton, //diSaveContactButton,
	diDateTime, diCategory, diStatus, diSensitivity, diAttendees, 
	diNotes, diReminder, diOccurs,diImportance,
};

/// List DATA
struct DataItem {
	int		        ID;
	LONG    	    oId;
	DataItemType    type;
	TCHAR           szPrimaryText[PRIMARY_TEXT_LENGTH];
	TCHAR		    szSecondaryText[SECONDARY_TEXT_LENGTH];
	TCHAR			szTertiaryText[SECONDARY_TEXT_LENGTH];  //allelimo: added
    UINT            iGroup;
   // bool            isFavorite; //ajige changed to isTask;
	bool			isTask;
    bool            isOverdue;
	bool			isUndated;
	//bool			
		VARIANT_BOOL isComplete; //ajige 1/20/10
};

struct ScreenDefinition {
	int hgScreen;
	TCHAR * filename;//5/3/10 unneccessary?? TODO
    int parent;
    bool hasMenus;
    HRESULT (*fnPopulate)(ScreenDefinition hgScreen,DataItem * parent, void (*adder)(DataItem*),
        CSettings * pSettings);
    HRESULT (*fnGetTitle)(ScreenDefinition  hgScreen,DataItem * parent, TCHAR * buffer, int cchDest,
        CSettings * pSettings);
    HRESULT (*fnGetGroup)(ScreenDefinition hgScreen, DataItem * data, TCHAR * buffer, int cchDest,
        CSettings * pSettings);
    HRESULT (*fnClick)(ScreenDefinition  hgScreen,DataItem * data, float x, int * newScreen,
        CSettings * pSettings);
    HRESULT (*fnAdd)(ScreenDefinition  hgScreen);  //ajige from void
    HRESULT (*fnToggleFavorite)(ScreenDefinition hgScreen, DataItem * data, CSettings * pSettings);
    HRESULT (*fnGetHBitmap)(DataItem * data, HBITMAP * phBitmap,   
                              UINT * puWidth, UINT * puHeight);
};

struct CmdLineArg {
    TCHAR * arg;
    WPARAM wparam;
};

enum TransitionType {
    ttSlideLeft,
    ttSlideRight,
    ttKeyboardExpand,
    ttKeyboardShrink,
	ttEditExpand, //5/3/10
    ttEditShrink, //5/3/10
	//4/15/10 FOR EDIT
	ttExpand,
    ttContract,
};

enum PopupType {
    ptKeyboard,
	ptEdit,//5/3/10
};

struct decodeUINT {                             // Structure associates
    UINT Code;                                  // messages 
                                                // with a function. 
    LRESULT (*Fxn)(HWND, UINT, WPARAM, LPARAM);
};

struct HistoryItem {
    int screen;
    int scrolled;
    int selectedIndex;
    DataItem data;
};
